#include "mainwindow.h"
#include "ui_mainwindow.h"

MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    ui->setupUi(this);
    timer = new QTimer(this);
    connect(timer, SIGNAL(timeout()), this, SLOT(ontime()));
    timer->start(1);
    createStatusBar();
}

MainWindow::~MainWindow()
{
    delete ui;
}

void MainWindow::ontime()
{
    ui->widget->onTimer();
}

void MainWindow::createStatusBar(){

}

void MainWindow::changeEvent(QEvent *e)
{
    QMainWindow::changeEvent(e);
    switch (e->type()) {
    case QEvent::LanguageChange:
        ui->retranslateUi(this);
        break;
    default:
        break;
    }
}

void MainWindow::on_checkBoxFogEnable_clicked(bool checked)
{
    ui->widget->setFog(checked);
}

void MainWindow::on_horizontalSliderFogDensity_valueChanged(int value)
{
    ui->widget->setFogDensity(value);
}
